package org.ycy.data.generator.generator;

import org.ycy.data.generator.entity.PollingCheckInfo;

import java.util.List;

/**
 * @ClassName PollingGenerator
 * @Description TODO
 * @Author 原长友
 * @Date 2023/3/5 22:55
 * @Version 1.0
 **/
public class PollingGenerator extends IGenerator<PollingCheckInfo> {

    private int index = 0;

    @Override
    public Object generator() {

        List<Object> selectionItems = checkInfo.getSelectionItems();
        Object o = selectionItems.get(index);
        index++;
        if (index > selectionItems.size() - 1) {
            index = 0;
        }
        return o;
    }
}
